$(function(){
	//导入脚部
	$('#login-foot').load('foot.html');
	//用户名失去焦点触发
	var uname;
	var upass;
	$('#i-last').click(function(){
		uname = $("#name").val();	
		console.log(uname)
		
		var strl = $.cookie(uname); 
       		o1 = JSON.parse(strl);　
			console.log(o1.name)
			console.log(o1.pass)
		if(uname==o1.name){
			console.log("有");
			upass = $("#pas").val();
			if(upass==o1.pass){
				console.log("ok");
				alert("ok")
				
				window.location.href="index.html";
				
			}else{
				console.log("error");
				alert("密码错误")
			}
			
		}
		if($.cookie(uname)==null){
			console.log("用户名不存在")
		}
	})
		
	

	
	
})


